<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "faq".
 *
 * @property integer $id
 * @property string $title
 * @property string $auth
 * @property string $content
 * @property string $seo_title
 * @property string $seo_keywords
 * @property string $seo_description
 * @property string $created_at
 * @property string $updated_at
 * @property integer $created_by
 * @property integer $updated_by
 */
class Faq extends BaseModel
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'faq';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title', 'content'], 'required'],
            [['content'], 'string'],
            [['created_at', 'updated_at'], 'safe'],
            [['created_by', 'updated_by'], 'integer'],
            [['title', 'seo_title'], 'string', 'max' => 64],
            [['auth'], 'string', 'max' => 32],
            [['seo_keywords'], 'string', 'max' => 128],
            [['seo_description'], 'string', 'max' => 512],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => '标题',
            'auth' => '作者',
            'content' => '正文',
            'seo_title' => '页面标题',
            'seo_keywords' => '页面关键字',
            'seo_description' => '页面描述',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
            'created_by' => '创建者',
            'updated_by' => '更新者',
        ];
    }
}
